<template>
    <div>
        <ul class="mui-table-view">
            <!-- <li class="mui-table-view-cell mui-media">
                <router-link to="/home/newsinfo">
                    <img class="mui-media-object mui-pull-left" src="http://gitee.com/uploads/91/465191_vsdeveloper.jpg"/>
                    <div class="mui-media-body">
                        <h1>幸福</h1>
                        <p class="mui-ellipsis">
                            <span>发表时间：2012-12-12 12:12:12</span>
                            <span>点击0次</span>
                        </p>
                    </div>
                </router-link>
                

            </li> -->
            <li class="mui-table-view-cell mui-media" v-for="item in newList" :key="item.tcount">
                <router-link :to="'/home/newsinfo/'+item.tcount">
                    <img class="mui-media-object mui-pull-left" :src="item.img"/>
                    <div class="mui-media-body">
                        <h1>{{item.digest}}</h1>
                        <p class="mui-ellipsis">
                            <span>发表时间：{{item.ptime | dateFormat}}</span>
                            <span>点击{{item.imgsrc3gtype}}次</span>
                        </p>
                    </div>
                </router-link>
            </li>
        </ul>
    </div>
</template>
<script>
import {Toast} from 'mint-ui'
export default {
    data(){
        return{
            newList:[]
        }
    },
    created(){
        this.getNewList()
    },
    methods: {
        getNewList(){
            this.$http.get('https://www.apiopen.top/journalismApi').then(res => {
                if(res.body.code == 200){
                    this.newList = res.body.data.auto
                } else {
                    Toast('获取新闻列表失败了！！！')
                }
            })
        }
    }
}
</script>
<style lang="scss" scoped>
.mui-table-view{
    li{
        h1{
            font-size: 14px;
        }
        .mui-ellipsis{
            font-size: 12px;
            color: #226aff;
            display: flex;
            justify-content: space-between;
        }
    }
}
</style>

